﻿using MIServices;
using Quartz;
using System;
using System.Threading.Tasks;

namespace MCronJob.Jobs
{
    public class HelloJob : IJob
    {
        private readonly IUserInfoServices _userInfoServices;
        public HelloJob(IUserInfoServices userInfoServices)
        {
            _userInfoServices = userInfoServices;
        }
        public async Task Execute(IJobExecutionContext context)
        {
            var userInfo = _userInfoServices.GetUserInfo();
            await Console.Out.WriteLineAsync($"{DateTime.Now:HH:mm:ss}--姓名：{userInfo.UserName},年龄：{userInfo.Age},地址：{userInfo.Address}");
        }
    }
}